package com.maigu.controller;

import com.maigu.dto.OrderDTO;
import com.maigu.enums.ResultEnum;
import com.maigu.exception.SellException;
import com.maigu.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 支付2020.2.15
 */
@Controller
@RequestMapping("/pay")
public class PayController {
    @Autowired
    private OrderService orderService;
    @GetMapping("/create")
public void create(@RequestParam("orderId") String orderId,@RequestParam("returnUrl") String returnUrl)
{
    //1查询订单中否存在
    OrderDTO orderDTO = orderService.findOne(orderId);
    if(orderDTO==null)
    {
        throw new SellException(ResultEnum.ORDER_NOT_EXIST);
    }
    //2发起支付返回支付状态
}
}
